# **********************************************************************
#
# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************

# Ice version 3.3.1
# Generated from file `LED.ice'

import Ice, IcePy, __builtin__

if not Ice.__dict__.has_key("_struct_marker"):
    Ice._struct_marker = object()
import TeRKCommon_ice

# Included module Ice
_M_Ice = Ice.openModule('Ice')

# Included module Glacier2
_M_Glacier2 = Ice.openModule('Glacier2')

# Included module peer
_M_peer = Ice.openModule('peer')

# Included module TeRK
_M_TeRK = Ice.openModule('TeRK')

# Start of module TeRK
__name__ = 'TeRK'

if not _M_TeRK.__dict__.has_key('LEDMode'):
    _M_TeRK.LEDMode = Ice.createTempClass()
    class LEDMode(object):

        def __init__(self, val):
            assert(val >= 0 and val < 3)
            self.value = val

        def __str__(self):
            if self.value == 0:
                return 'LEDOn'
            elif self.value == 1:
                return 'LEDOff'
            elif self.value == 2:
                return 'LEDBlinking'
            return None

        __repr__ = __str__

        def __hash__(self):
            return self.value

        def __cmp__(self, other):
            return cmp(self.value, other.value)

    LEDMode.LEDOn = LEDMode(0)
    LEDMode.LEDOff = LEDMode(1)
    LEDMode.LEDBlinking = LEDMode(2)

    _M_TeRK._t_LEDMode = IcePy.defineEnum('::TeRK::LEDMode', LEDMode, (), (LEDMode.LEDOn, LEDMode.LEDOff, LEDMode.LEDBlinking))

    _M_TeRK.LEDMode = LEDMode
    del LEDMode

if not _M_TeRK.__dict__.has_key('_t_LEDModeArray'):
    _M_TeRK._t_LEDModeArray = IcePy.defineSequence('::TeRK::LEDModeArray', (), _M_TeRK._t_LEDMode)

if not _M_TeRK.__dict__.has_key('LEDCommandException'):
    _M_TeRK.LEDCommandException = Ice.createTempClass()
    class LEDCommandException(_M_TeRK.CommandException):
        def __init__(self, reason=''):
            _M_TeRK.CommandException.__init__(self, reason)

        def ice_name(self):
            return 'TeRK::LEDCommandException'

        def __str__(self):
            return IcePy.stringifyException(self)

        __repr__ = __str__

    _M_TeRK._t_LEDCommandException = IcePy.defineException('::TeRK::LEDCommandException', LEDCommandException, (), _M_TeRK._t_CommandException, ())
    LEDCommandException.ice_type = _M_TeRK._t_LEDCommandException

    _M_TeRK.LEDCommandException = LEDCommandException
    del LEDCommandException

if not _M_TeRK.__dict__.has_key('LEDCommand'):
    _M_TeRK.LEDCommand = Ice.createTempClass()
    class LEDCommand(object):
        def __init__(self, ledMask=None, ledModes=None):
            self.ledMask = ledMask
            self.ledModes = ledModes

        def __hash__(self):
            _h = 0
            if self.ledMask:
                for _i0 in self.ledMask:
                    _h = 5 * _h + __builtin__.hash(_i0)
            if self.ledModes:
                for _i1 in self.ledModes:
                    _h = 5 * _h + __builtin__.hash(_i1)
            return _h % 0x7fffffff

        def __cmp__(self, other):
            if other == None:
                return 1
            if self.ledMask < other.ledMask:
                return -1
            elif self.ledMask > other.ledMask:
                return 1
            if self.ledModes < other.ledModes:
                return -1
            elif self.ledModes > other.ledModes:
                return 1
            return 0

        def __str__(self):
            return IcePy.stringify(self, _M_TeRK._t_LEDCommand)

        __repr__ = __str__

    _M_TeRK._t_LEDCommand = IcePy.defineStruct('::TeRK::LEDCommand', LEDCommand, (), (
        ('ledMask', (), _M_TeRK._t_BooleanArray),
        ('ledModes', (), _M_TeRK._t_LEDModeArray)
    ))

    _M_TeRK.LEDCommand = LEDCommand
    del LEDCommand

if not _M_TeRK.__dict__.has_key('LEDController'):
    _M_TeRK.LEDController = Ice.createTempClass()
    class LEDController(_M_TeRK.AbstractCommandController):
        def __init__(self):
            if __builtin__.type(self) == _M_TeRK.LEDController:
                raise RuntimeError('TeRK.LEDController is an abstract class')

        def ice_ids(self, current=None):
            return ('::Ice::Object', '::TeRK::AbstractCommandController', '::TeRK::LEDController', '::TeRK::PropertyManager')

        def ice_id(self, current=None):
            return '::TeRK::LEDController'

        def ice_staticId():
            return '::TeRK::LEDController'
        ice_staticId = staticmethod(ice_staticId)

        #
        # Operation signatures.
        #
        # def execute(self, command, current=None):

        def __str__(self):
            return IcePy.stringify(self, _M_TeRK._t_LEDController)

        __repr__ = __str__

    _M_TeRK.LEDControllerPrx = Ice.createTempClass()
    class LEDControllerPrx(_M_TeRK.AbstractCommandControllerPrx):

        def execute(self, command, _ctx=None):
            return _M_TeRK.LEDController._op_execute.invoke(self, ((command, ), _ctx))

        def execute_async(self, _cb, command, _ctx=None):
            return _M_TeRK.LEDController._op_execute.invokeAsync(self, (_cb, (command, ), _ctx))

        def checkedCast(proxy, facetOrCtx=None, _ctx=None):
            return _M_TeRK.LEDControllerPrx.ice_checkedCast(proxy, '::TeRK::LEDController', facetOrCtx, _ctx)
        checkedCast = staticmethod(checkedCast)

        def uncheckedCast(proxy, facet=None):
            return _M_TeRK.LEDControllerPrx.ice_uncheckedCast(proxy, facet)
        uncheckedCast = staticmethod(uncheckedCast)

    _M_TeRK._t_LEDControllerPrx = IcePy.defineProxy('::TeRK::LEDController', LEDControllerPrx)

    _M_TeRK._t_LEDController = IcePy.defineClass('::TeRK::LEDController', LEDController, (), True, None, (_M_TeRK._t_AbstractCommandController,), ())
    LEDController.ice_type = _M_TeRK._t_LEDController

    LEDController._op_execute = IcePy.Operation('execute', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, (), (((), _M_TeRK._t_LEDCommand),), (), None, (_M_TeRK._t_LEDCommandException,))

    _M_TeRK.LEDController = LEDController
    del LEDController

    _M_TeRK.LEDControllerPrx = LEDControllerPrx
    del LEDControllerPrx

# End of module TeRK
